﻿<!--#include file="../inc/common.asp" -->
<!--#include file="waputil.asp" -->
<%
  response.contentType="text/vnd.wap.wml"
  'response.contentType="text/xml"
  response.charset=DEFAULT_CHARSET
  response.buffer = true  

  on error resume next

  dim misslog, blogItems, count, i, j, blogItem, cardTitle, pageno, url
  pageno = request("pageno_list")
  if isEmpty(pageno) or int(pageno)<1 then
    pageno=1
  else
  	pageno = int(pageno)
  end if
  
  if request("blog_id")="" then
    set misslog = new MLHostClass
    misslog.load()
    blogItems = misslog.getTopNewItems()
    cardTitle="最新文章"
    url = "list.asp"
  else
    blogItems = blogCatObj.getBlogItems(pageno) 
    cardTitle = blogObj.blogTitle
    
    url = "list.asp?blog_id=" & blogObj.blogId
  end if

  if isArray(blogItems) then
    count = ubound(blogItems)
  end if
%>
<?xml version="1.0" encoding="<%=DEFAULT_CHARSET%>"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapfourm.org/DTD/wml_1.1.xml">
<wml>
<card title="<%=cardTitle%>" newcontext="false" ordered="true">
<p align="left">
<%
  if request("blog_id")<>"" and userRightObj.canPost then
%>
[<a href="edit.asp?blog_id=<%=blogObj.blogId%>">发布文章</a>]<br/>
<%
  end if
  if count>0 then
    j = 1
    for i=0 to count-1
      set blogItem = blogItems(i)
      if not blogItem.isSecret or userRightObj.canReadSecret then
%>
<%=(pageno-1)*blogCatObj.pageSize + j%>.<a href="detail.asp?blog_id=<%=blogItem.blogId%>&amp;content_id=<%=blogItem.itemId%>&amp;pageno_list=<%=request("pageno_list")%>"><%=HTML2WML(blogItem.title)%></a>&nbsp;-<%=HTML2WML(blogItem.userName)%><br/>
<%
        j = j+1
      end if
      set blogItem = nothing
    next
  end if
  if request("blog_id")<>"" then
%>
<%=wmlPageLink2(pageno,  blogCatObj.pageSize, blogCatObj.totalItemCount, url, "pageno_list")%><br/>
<%
  end if
%>
<a href="comments.asp?blog_id=<%=request("blog_id")%>">[查看最新评论]</a><br/>
<a href="index.asp">[返回站点首页]</a>
</p>
<%
  writeBlogOptions
%>
</card>
</wml>
<%
  set misslog = nothing
  closeDB()
  'session.abandon
%>